<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>HTML-ZMS</title>
    <script>

        function loadfromtxt()
        {

            var httprequest;
            httprequest=new XMLHttpRequest();
            httprequest.onreadystatechange=function()
            {

                if (httprequest.readyState==4 && httprequest.status==200)
                {
                    document.getElementById("myDiv").innerHTML=httprequest.responseText;
                }
                else
                    document.getElementById("myDiv").innerHTML="没拿到";
            }

            httprequest.open("GET","../files/my.txt",true);
            //传递参数 仅用于post ,GET  send()不用写
            httprequest.send();
        }

    </script>

</head>

<body>

<input type="button" value="更新数据" onclick="loadfromtxt()">

<div id="myDiv">3333</div>
</body>
</html>
